<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D发光旋转正方体案例</title>
    <style>
        body {
            height: 100vh;
            background-image: radial-gradient(#000,lightyellow,#000);
        }
        /* 给所有面设置统一样式*/
        .boxs>div {
            width: 200px;
            height: 200px;
            border: 3px solid red;
            font-size: 80px;
            text-align: center;
            line-height: 200px;
            position: absolute;
            border: 1px solid gold;
            color: gold;
            border-radius: 30px;
            background-color: rgba(255,255,255,0.6);
            box-shadow: 0 0 60px 0 gold;
        }
        .show {
            perspective: 800px;
        }
        .boxs {
            transform-style: preserve-3d;
            width: 200px;
            height: 200px;
            margin: 200px auto;
            animation: turn 10s linear infinite;
        }
        .boxs:hover {
            animation-play-state: paused;
        }
        .boxs>.p1 {
            transform: translateZ(100px);
        }
        .boxs>.p2 {
            transform: translateZ(-100px) scaleX(-1);
        }
        .boxs>.p3 {
            transform: rotateY(90deg) translateZ(100px);
        }
        .boxs>.p4 {
            transform: rotateY(90deg) translateZ(-100px) scaleX(-1);
        }
        .boxs>.p5 {
            transform: rotateX(90deg) translateZ(100px);
        }
        .boxs>.p6 {
            transform: rotateX(90deg) translateZ(-100px) scaleX(-1);
        }
        @keyframes turn {
            100% {
                transform: rotate3d(1,1,0,360deg);
            }
        }
    </style>
</head>
<body>
    <div class="show">
        <div class="boxs">
            <!-- 正方体的6个面 -->
            <div class="p1">1</div>
            <div class="p2">2</div>
            <div class="p3">3</div>
            <div class="p4">4</div>
            <div class="p5">5</div>
            <div class="p6">6</div>
        </div>
    </div>
</body>
</html>